package student;

import java.util.HashSet;
import java.util.Set;

public class Main {
    public static void main(String[] args) {
        Set<Student> students = new HashSet<>();
        //Set集合去重原理 先判断哈希值再判断equals
        Student student = new Student("zhang",12,"男");
        Student student1 = new Student("zhang",12,"男");
        Student student2 = new Student("li",13,"女");
        System.out.println(student.hashCode());
        System.out.println(student1.hashCode());
        System.out.println(student2.hashCode());
        students.add(student);
        students.add(student1);
        students.add(student2);
        System.out.println(students);
    }
}
